<!DOCTYPE html>
<html>
<head>
    <title>午托饭-代码生成器</title>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="css/font-awesome.min.css">
    <link rel="stylesheet" href="plugins/jqgrid/ui.jqgrid-bootstrap.css">
    <link rel="stylesheet" href="css/main.css">
    <link rel="stylesheet" href="css/element.css">
    <script src="libs/jquery.min.js"></script>
    <script src="plugins/layer/layer.js"></script>
    <script src="libs/bootstrap.min.js"></script>
    <script src="libs/vue.min.js"></script>
    <script src="libs/element.js"></script>
    <script src="plugins/jqgrid/grid.locale-cn.js"></script>
    <script src="plugins/jqgrid/jquery.jqGrid.min.js"></script>
    <script src="js/common.js"></script>
</head>
<body>
<div id="rrapp">
    <div class="grid-btn">
        <div class="form-group col-sm-2">
            <input type="text" class="form-control" v-model="ds" @keyup.enter="query" placeholder="数据源名称">
        </div>
        <a class="btn btn-default" @click="query">查询</a>
        <a class="btn btn-default" @click="clear">重置</a>
        <el-button class="btn btn-primary" type="primary" plain  @click="dialogVisible = true">创建数据源</el-button>
        <el-dialog title="编辑数据源" :visible.sync="dialogVisible" width="30%">
            <!--弹出的对话框的内容-->
            <el-form ref="form" :model="addDs" label-width="120px">
                <el-form-item label="数据库类型">
                    <el-select v-model="addDs.dbType" clearable placeholder="请选择">
                        <el-option
                                v-for="(item,index) in dbTypes"
                                :key="index"
                                :label="item"
                                :value="item">
                        </el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="数据源名称">
                    <el-input v-model="addDs.ds"></el-input>
                </el-form-item>
                <el-form-item label="主机地址">
                    <el-input v-model="addDs.host"></el-input>
                </el-form-item>
                <el-form-item label="端口">
                    <el-input v-model="addDs.port"></el-input>
                </el-form-item>
                <el-form-item label="账号">
                    <el-input v-model="addDs.username"></el-input>
                </el-form-item>
                <el-form-item label="密码">
                    <el-input v-model="addDs.password"></el-input>
                </el-form-item>
                <el-form-item label="数据库名称">
                    <el-input v-model="addDs.dbName"></el-input>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" @click="testCon">连接测试</el-button>
                    <el-button @click="createDs">立即创建</el-button>
                    <el-button @click="dialogVisible = false">取消</el-button>
                </el-form-item>
            </el-form>
        </el-dialog>
        <a class="btn btn-default" @click="del">删除</a>
    </div>
    <table id="jqGrid"></table>
    <div id="jqGridPager"></div>
</div>

<script src="js/ds.js"></script>
</body>
</html>